package com.personal.kousuan;

import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentTransaction;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;
import android.widget.Button;

public class HomeFragment extends Fragment {

	private Button startBtn;
	@Override
	public View onCreateView(LayoutInflater inflater, ViewGroup container,
			Bundle savedInstanceState) {
		View view =  inflater.inflate(R.layout.exercise_tab, container, false);
		
		startBtn = (Button)view.findViewById(R.id.start_btn);
		
		startBtn.setOnClickListener(new OnClickListener() {
			
			@Override
			public void onClick(View v) {
				Fragment  questionListFragment = new KouSuanQuestionListFragment();
				FragmentTransaction transaction = getFragmentManager().beginTransaction();
				transaction.replace(R.id.exercise_fragment, questionListFragment);
				
//				transaction.addToBackStack(null);
				transaction.commit();
				
				
			}
		});
		return view;
	}

}
